package com.lapian.designmode.flyweight.test.test_f2;

import java.util.HashMap;

/**
 * 创建日期：2022/6/8 0008 17:56
 *
 * @author tony.sun
 * 类说明：
 */
public class FactoryF {
    HashMap<String,ConcreteRoleF2> pool=new HashMap<>();
    public AbstractRoleF2 getCategory(String type) {
        if (!pool.containsKey(type)) pool.put(type,new ConcreteRoleF2(type));
        return (AbstractRoleF2)pool.get(type);
    }

    public int getPoolSize() {
        return pool.size();
    }
}
